package com.zhangxujie.litewords.dao;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.RawQuery;
import androidx.room.Update;

import com.zhangxujie.litewords.entity.ReciteWords;
import com.zhangxujie.litewords.entity.Words;

import java.util.List;

@Dao
public interface ReciteWordsDAO {



    @Insert
    void insertAll(ReciteWords... infos);


    @Query("SELECT count(*) FROM (SELECT word_id FROM recite_words as rw GROUP BY rw.word_id)")
    int count();

    @Query("SELECT * FROM recite_words WHERE word_id=:wordId")
    List<ReciteWords> findByWordId(int wordId);





}